package com.insigma.business.qrcode.soldier.dto;


import com.insigma.business.qrcode.common.vo.DescEnum;

import java.util.LinkedHashMap;
import java.util.Map;


public enum UserStatusEnum implements DescEnum {

    
    ENABLED("启用"),

    
    DISABLED("禁用"),

    
    LOCKED("锁定"),

    
    EXPIRED("过期"),


    ;

    
    private String desc;

    UserStatusEnum(String desc) {
        this.desc = desc;
    }

    
    public static UserStatusEnum getByEnumName(final String enumName) {
        for (UserStatusEnum element : values()) {
            if (element.name().equals(enumName)) {
                return element;
            }
        }
        return null;
    }

    
    public static Map<String,String> getName2TitleMap(){

        Map<String,String> name2TitleMap = new LinkedHashMap <>();

        for (UserStatusEnum element : values()) {
            name2TitleMap.put(element.name(),element.desc);
        }

        return name2TitleMap;
    }

    @Override
    public String getDesc() {
        return this.desc;
    }

}
